package com.teamclub.app.scontrollers.systemmanager

import com.teamclub.app.sforms.AppRoleForm
import com.teamclub.app.sservices.systemmanager.AppRoleService
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{PostMapping, RequestBody, RequestMapping, RestController}

/**
  * Created by ilkkzm on 17-8-11.
  */
@RestController("com.teamclub.app.scontrollers.systemmanager.AppRoleController")
@RequestMapping(Array("/app/systemmanager"))
class AppRoleController {

  @Autowired
  var appRoleService: AppRoleService = _

  @PostMapping(Array("rolelist"))
  def list(@RequestBody form: AppRoleForm) = {
    Eithers.toJson(appRoleService.list(form))
  }
  @PostMapping(Array("roleadd"))
  def add(@RequestBody form: AppRoleForm) = {
    Eithers.toJson(appRoleService.add(form))
  }
  @PostMapping(Array("roledel"))
  def del(@RequestBody form: AppRoleForm) = {
    Eithers.toJson(appRoleService.del(form))
  }
}
